From 5c197fd2145db96cb4612ab9e95ca31e7b46d929 Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 18 Mar 2004 16:26:25 +0000 Subject: [PATCH] add 'correct' option to duplicate filter --- gpsbabel/README | 8 +++++++- gpsbabel/duplicate.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gpsbabel/README b/gpsbabel/README index d5444e9aa..c9c48e0a4 100644 --- a/gpsbabel/README +++ b/gpsbabel/README @@ -571,7 +571,13 @@ DATA FILTERS with the "all" option. This option can be useful as an "ignore list" in some circumstances. - DISTANCE ALONG A ROUTE (ARC) + Finally, the duplicate filter takes a "correct" option. If you + specify that option, the latitude and longitude frmo later duplicates + will replace the latitude and longitude in earlier waypoints. You + can use this to apply a list of "waypoint corrections" to a larger + file, while keeping all of the other details from the larger file. + + DISTANCE FROM A ROUTE (ARC) ARC The arc filter is designed to include points based on their diff --git a/gpsbabel/duplicate.c b/gpsbabel/duplicate.c index e9213ad5d..6ff4ceb0e 100644 --- a/gpsbabel/duplicate.c +++ b/gpsbabel/duplicate.c @@ -26,6 +26,7 @@ extern queue waypt_head; static char *snopt = NULL; static char *lcopt = NULL; static char *purge_duplicates = NULL; +static char *correct_coords = NULL; static arglist_t dup_args[] = { @@ -35,6 +36,8 @@ arglist_t dup_args[] = { ARGTYPE_BOOL}, {"all", &purge_duplicates, "Suppress all instances of duplicates", ARGTYPE_BOOL}, + {"correct", &correct_coords, "Use coords from duplicate points", + ARGTYPE_BOOL}, {0, 0, 0, 0} }; @@ -271,6 +274,10 @@ duplicate_process(void) if ( delwpt ) { waypt_free(delwpt); } + if ( correct_coords && oldnode && oldnode->wpt ) { + oldnode->wpt->latitude = waypointp->latitude; + oldnode->wpt->longitude = waypointp->longitude; + } delwpt = waypointp; waypt_del(waypointp); /* collision */ xfree(newnode); -- 2.30.2